package com.floreantpos.config;

import java.awt.Font;
import java.util.Enumeration;

import javax.swing.UIManager;
import javax.swing.plaf.FontUIResource;

public class UIConfig {
	
	static String defaultFont = "宋体";
	
	public final static Font buttonFont = new java.awt.Font(defaultFont, 1, 12);
	public final static Font largeFont = new java.awt.Font(defaultFont, 1, 16);
	public final static Font labelFont = new java.awt.Font(defaultFont, 1, 18);
	public final static Font labelLargeFont = new java.awt.Font(defaultFont, 1, 24);
	public final static Font labelSmallFont = new java.awt.Font(defaultFont, 1, 12);
	public final static Font labelHugeFont = new java.awt.Font(defaultFont, 1, 36);
	public final static Font labelVeryHugeFont = new java.awt.Font(defaultFont, 1, 48);
	
	
	public UIConfig() {
		super();
	}

	public static void initFont(){
	    FontUIResource fontRes = new FontUIResource(largeFont);
	    for(Enumeration keys = UIManager.getDefaults().keys(); keys.hasMoreElements();){
	        Object key = keys.nextElement();
	        Object value = UIManager.get(key);
	        if(value instanceof FontUIResource)
	            UIManager.put(key, fontRes);
	    }
	}
	
}
